<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
    }

    .box1 {
      background-color: red;
    }

    .box2 {
      background-color: green;
    }

    .box3 {
      background-color: blue;
      border-radius: ;
    }
  </style>
</head>

<body>
  <a href="http://www.baidu.com">跳转到百度</a>
  <div class="box1">div1</div>
  <div class="box2">div2</div>
  <div class="box3">div3</div>
  <script>
    // 1. 获取DOM对象(拿到1个)
    let box1 = document.querySelector('div')
    // console.dir(box1)
    box1.onclick = () => {
      // alert('点我吗?')
      box1.style.borderRadius = '50%'
      box1.style.backgroundColor = 'pink'
    }

    // 2. 获取多个DOM对象
    let boxArr = document.querySelectorAll('.box1')
    console.log(boxArr)
  </script>
</body>

</html>